Page({
  data: {
    showSection:"",
    showFlag:false,
    list:[
      {title:"安神药",info:"-简单-    共20味中药", cost:"1"},
      {title:"解表药",info:"-简单-    共20味中药", cost:"1"},
      {title:"去火药",info:"-困难-    共20味中药", cost:"2"},
      {title:"安神药",info:"-简单-    共20味中药", cost:"1"},
      {title:"安神药",info:"-中等-    共20味中药", cost:"2"},
      {title:"安神药",info:"-简单-    共20味中药", cost:"1"}
    ]
  },
  onLoad: function (options) {
    let that=this;
    wx.showLoading({
      title: '加载中',
    })
    wx.cloud.callFunction({
      name:'updata',
      data:{
        action:"select_dictionaryList"
      },
      complete:res=>{
        console.log(res);
        that.setData({
          list:res.result.data
        })
        wx.hideLoading({
          success: (res) => {},
        })
      }
    })
  },
  toTestPage: function (e) {
    console.log(e)
    this.setData({
      showSection:e.currentTarget.dataset.testid,
      showFlag:~this.data.showFlag
    })
  },
  toDictonaryList(e){
    let testId = e.currentTarget.dataset['testid'];
    console.log(testId)
    wx.navigateTo({
      url: '../dictRoot2/dictRoot2?testid='+testId
      // ?testId=' + testId
    })
  }
})